<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        // 同步执行 按照顺序固定去执行
        console.log('开始');
        console.log('进行中');
        console.log('结束');


        // 异步执行：异步执行不会影响主线程的执行
        console.log('开始1');
        setTimeout(p=>{
            console.log('进行中1');
        },1)
        console.log('结束1');
        

        for(var i=0;i<5;i++){
          
            setTimeout(o=>{
                console.log(i);
            },1)
            
        }
        for(let i=0;i<5;i++){
            setTimeout(o=>{
                console.log(i);
            },1)
            
        }

        setTimeout(p=>{
            console.log(nums);
        },1)
        

        let nums = 6666666
        
        
    </script>
</body>
</html>